package cn.echo.hrm.controller;

import cn.echo.hrm.doc.CourseDoc;
import cn.echo.hrm.repository.CourseElasticSearchRepository;
import cn.echo.hrm.service.ICourseElasticSearchService;
import cn.echo.hrm.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/course")
public class CourseESController {

    @Autowired
    private ICourseElasticSearchService courseElasticSearchService;

    @PostMapping("/add")
    public AjaxResult add(@RequestBody CourseDoc doc){
        courseElasticSearchService.add(doc);
        return AjaxResult.me();
    }
}
